<?php
/**
 * Construit le menu de navigation
 */
function bloc_navigation()
{
    $GLOBALS['smarty']->caching = 1;

    if( !$GLOBALS['smarty']->isCached('bloc_navigation.tpl')):
        $req = $GLOBALS['db']->prepare("SELECT titre, lien, description FROM ". PREFIX ."menu_navigation WHERE actif = 1 ORDER BY ordre");
        $req->execute();

        $liens = $req->fetchAll();

        $GLOBALS['smarty']->assign('liens', $liens);
    endif;
    
    $l = $GLOBALS['smarty']->fetch('bloc_navigation.tpl');

    $GLOBALS['smarty']->caching = 0;

    return $l;
}

?>
